package com.jeeplus.common.model;

public class ResultModel<T> {

    public static final Integer OK = 200;

    private Integer code;

    private String message;

    private T data;

    public static ResultModel succResult(Object data) {
        ResultModel resultModel = new ResultModel();
        resultModel.setCode(OK);
        resultModel.setData(data);
        return resultModel;
    }

    public static ResultModel succResult() {
        ResultModel resultModel = new ResultModel();
        resultModel.setCode(OK);
        return resultModel;
    }

    public static ResultModel failResult(String message) {
        ResultModel resultModel = new ResultModel();
        resultModel.setCode(9000);
        resultModel.setMessage(message);
        return resultModel;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}